<script setup>
import data from "./data/data-grid.json"
import meta from "./data/data-grid-meta.json"
import treeData from "./data/treedata.json"

import DataGrid from "./components/DataGrid.vue"
import Tree from "./components/Tree.vue";
import { ref } from "vue";

const gridModel = ref(data);
const treeModel = ref(treeData);

function onRowCommand(args) {
  console.log(JSON.stringify(args));
}

</script>
<template>
  <div class="common-layout">
    <el-container>
      <el-aside width="260px">
        <tree :model="treeModel">

        </tree>
      </el-aside>
      <el-main>
        <el-container>
          <el-header>
            
          </el-header>
          <el-main>
            <data-grid :meta="meta" :model="gridModel" @row-command="onRowCommand"></data-grid>
          </el-main>
        </el-container>
      </el-main>
    </el-container>
  </div>
</template>